package com.example.active.spring;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;

/**
 * @author 朝花不迟暮
 * @version 1.0
 * @date 2020/9/17 16:16
 */
//@Component
public class ProducerSpring
{
    @Autowired
    private JmsTemplate jmsTemplate;

    public static void main(String[] args)
    {
//        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
//        System.out.println("bean实例的样子是"+ ctx);
//        ProducerSpring producerSpring = (ProducerSpring) ctx.getBean("producerSpring");
//        producerSpring.jmsTemplate.send(session -> session.createTextMessage("spring整合ActiveMQTopic Listening..."));
//        System.out.println("send task over...");
    }
}
